package com.wyh.cloud.feign.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import pojo.CommonResult;
import pojo.Payment;

import java.util.concurrent.TimeUnit;

/**
 * @author wyh
 * @version 1.0
 * @date 2021/11/17 10:58
 */
@Component
@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
public interface PaymentFeignService {

    @GetMapping(value = "/payment/getPaymentById/{id}")
    CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);


    @PostMapping(value = "/payment/add")
    CommonResult<Payment> addPayment(@RequestBody Payment payment);

    @GetMapping("/payment/lb")
    public String lbPort();

    @GetMapping(value = "/payment/timeout")
    public String timeout();
}
